﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;
using System.Web.Mvc;

namespace Anmlz.Web.App_Start
{
    using Anmlz.Web.Infrastructure;

    public static class RouteInitializer
    {
        public static void Initialize(HttpConfiguration config, RouteCollection routes)
        {
            routes.MapHttpRoute(
                name: "BreedImage",
                routeTemplate: "api/breeds/{id}/image",
                defaults: new { controller = "breeds" }
                );

            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                ).RouteHandler = new SessionRouteHandler();

            routes.MapRoute("Application", "{*url}", new { controller = "Home", action = "Index" }, new[] { "MyApp.Web.Controllers" });
        }
    }
}